package iglesia.invimosa.lyrics.manager.datalayer;

import java.util.LinkedList;
import java.util.ListIterator;

public class ReproductionList {
	private String listName;
	private LinkedList<Songs> songList;
	private static ListIterator<Songs> li;
	private Songs song;
	
	public ReproductionList() {
		songList = new LinkedList<Songs>();
		li = songList.listIterator();
	}
	
	public ReproductionList(String name){
		this.listName = name;
		songList = new LinkedList<Songs>();
		li = songList.listIterator();
	}
	
	public ReproductionList(LinkedList<Songs> songsList){
		this.songList = songsList;
		li = songList.listIterator();
	}
	
	public ReproductionList(String name, LinkedList<Songs> songsList){
		this.listName = name;
		this.songList = songsList;
		li = songList.listIterator();
	}
	
	public boolean addSongToList(Songs song){
		return this.songList.add(song);
	}
	
	public boolean removeSongFromList(Songs song){
		return this.songList.remove(song);
	}
	
	public Songs getPreviousSong() {
		if(li.hasPrevious()) {
			return li.previous();
		}else{
			return null;
		}
	}
	
	public String getListName() {
		return this.listName;
	}
	
	public Songs getNextSong() {
		if(li.hasNext()) {
			song = (Songs)li.next();
			return song;
		}else{
			return null;
		}
	}
}
